#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

#define flr(x,l,r) for (int x = l; x <= r; ++ x)
#define frl(x,r,l) for (int x = r; x >= l; -- x)
#define LL long long 
#define szf sizeof
#define mt memset
#define in(x) scanf("%d", &x)
#define out(x) printf("%d", x)
#define inll(x) scanf("%lld", &x)
#define outll(x) printf("%lld", x)
#define pn printf("\n")
#define con continue
#define bk break
#define vc vector 
#define pb push_back
#define sz size
#define PII pair<int, int>

using namespace std;

const int N = 5010;

int n, s;
int sumt[N], sumc[N];
int f[N];
int q[N];

int main() {
	in(n), in(s);
	
	flr (i, 1, n) {
	    int t, c;
	    in(t), in(c);
	    sumt[i] += sumt[i - 1] + t;
	    sumc[i] += sumc[i - 1] + c;
	}
	
	mt(f, 0x3f, szf f);
	f[0] = 0;
	
	flr (i, 1, n)
	    flr (j, 0, i - 1)
	        f[i] = min(f[i], f[j] + sumt[i] * (sumc[i] - sumc[j]) + s * (sumc[n] - sumc[j]));
	        
	out(f[n]), pn;
	
	return 0;
}